package com.city.service.party.impl;

import com.city.domain.party.ReportGroup;
import com.city.repository.party.ReportGroupRepository;
import com.city.service.party.ReportGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReportGroupServiceImpl implements ReportGroupService{
    @Autowired
    private ReportGroupRepository reportGroupRepository;


    @Override
    public void saveAll(ReportGroup reportGroup) {
        reportGroupRepository.save(reportGroup);
    }

    @Override
    public List<ReportGroup> findByPage(Integer page, Integer limit) {
        return reportGroupRepository.findAllByPage((page-1)*limit,limit);
    }

    @Override
    public long count() {
        return reportGroupRepository.count();
    }

    @Override
    public ReportGroup findById(int id) {
        return reportGroupRepository.findOne(id);
    }

    @Override
    public void delete(int id) {
        reportGroupRepository.delete(id);
    }
}
